package com.bohua.child.controller;

import com.bohua.child.common.Lay;
import com.bohua.child.common.Msg;
import com.bohua.child.entity.Cclass;
import com.bohua.child.service.CclassService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
/**
 * 班级表控制器
 * @author shichenyang
 * @email gyv12345@163.com
 * @date 2019/01/17
 */
@Controller
@RequestMapping("/cclass")
public class CclassController {
    @Resource
    private CclassService cclassService;

    @RequestMapping
    public String cclass(){
        return "cclass/cclass.html";
    }
    @RequestMapping("/add")
    public String add(){
        return "cclass/addCclass.html";
    }

    @RequestMapping("/update")
    public String update(){
        return "cclass/updateCclass.html";
    }

    @RequestMapping("/getCclasss")
    @ResponseBody
    public Lay getCclasss(Cclass cclass,Integer page,Integer limit){
        return cclassService.getCclasss(cclass,page,limit);
    }
    @RequestMapping("/addCclass")
    @ResponseBody
    public Msg addCclass(Cclass cclass){
        return cclassService.addCclass(cclass);
    }

    @RequestMapping("/updateCclass")
    @ResponseBody
    public Msg updateCclass(Cclass cclass){
        return cclassService.updateCclass(cclass);
    }

    @RequestMapping("/delCclass")
    @ResponseBody
    public Msg delCclass(Cclass cclass){
        return cclassService.delCclass(cclass);
    }
}
